package com.study.config;

import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhuzi
 * 2024/3/25 17:36
 */
@Configuration
public class RedissonConfig {

    //@Bean
    public RBloomFilter<String> rBloomFilter(RedissonClient redisson) {
        //构造器参数为位图大小(可以理解为过滤面的大小)
        RBloomFilter<String> repetition = redisson.getBloomFilter("bloomFilter:msg");
        repetition.tryInit(1024 * 1024, 0.003);
        return repetition;
    }
}
